﻿/*
=======================================================
    Mpa【抗拉强度等级】
=======================================================
*/

namespace Services
{
    public interface IMpaRepository : IRepository<Mpa>
    {
        int UpdateIsDelete(bool flag, int[] ids);
    }


    public class MpaRepository : BaseRepository<Mpa>, IMpaRepository
    {
        public MpaRepository(ISqlSugarClient dB, ICurrentUser currentUser, IQuery<Mpa> query)
            : base(dB, currentUser, query)
        {
        }

        #region 启用/禁用  UpdateIsDelete
        public int UpdateIsDelete(bool flag, int[] ids)
        {
            return _DB.Updateable<Mpa>()
                      .SetColumns(x => new Mpa { IsDelete = flag })
                      .Where(x => ids.Contains(x.MpaID))
                      .ExecuteCommand();
        }
        #endregion
        
    }
}
